{% extends "pr_j/admin/admin_base.html" %}

{% block title %}Index of all projects{% endblock %}

{% block article %}

    <h1>Index of all projects</h1>
    <p><a href="{% url pr_j_admin_create %}">New project</a></p>
	<h2>Existing projects</h2>
    {% if projects %}
        {% for project in projects %}
            <div>
            	<a href="{% url pr_j_admin_edit project.slug %}">{{ project.title }}</a>
				<form action="{% url pr_j_admin_delete %}" method="POST">
					<input type="hidden" name="slug" value="{{ project.slug }}">
			        <input type="submit" value="Delete">
			    </form>
			</div>
        {% endfor %}
    {% else %}
       <p>No projects yet.</p>
    {% endif %}
{% endblock %}